package com.kaifamiao.www.demo.D0719;

public class De01 {
    public static void main(String[] args) {
        int[] nums = new int[]{10, 20, 30, 40, 50};
        int max = nums[0];
        int min = nums[0];
        //if语句
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] > max){
                max = nums[i];
            }
             if (nums[i] < min){
                 min = nums[i];
             }
        }
        System.out.println("最大值="+max);
        System.out.println("最小值="+min);
    }
  }

